package com.hf.job

import com.hf.fetch.MailFetchService
import com.hf.init.InitService

class FetchJob {

	MailFetchService mailFetchService
	InitService initService

	static triggers = {
		// 11:00, default: Monday-Friday(cron: 2-6)
		cron name: 'fetchJob', cronExpression: "0 0 11 ? * 1-7"
	}

	def execute() {
		// execute job
		log.info "job run!"

		mailFetchService.sendMail()
		initService.endFetch()

		log.info "fetch email success"
	}
}
